﻿$(document).ready(function () {
    $('.ui-select').addClass('ui-btn-right');

    $('#site-header-select-logouted-menu a,#site-header-select-logined-menu a').click(function () {
        switch ($(this).text()) {
            case "登录":
                $.mobile.changePage("/Home/Login", {
                    transition: $.mobile.defaultPageTransition,
                    role:"dialog"
                });
                break;
            case "注册":
                $.mobile.changePage("/Home/Regist", {
                    transition: $.mobile.defaultPageTransition,
                    role: "dialog"
                });
                break;
            case "个人中心":
                alert("3");
                break;
            case "退出登录":
                alert("4");
                break;
        }
    });
});

function setDefaultTransition() {
    var winwidth = $(window).width(), trans = "slide";

    if (winwidth >= 650) {
        trans = "fade";
    }

    $.mobile.defaultPageTransition = trans;
}


$(function () {
    setDefaultTransition();
    $(window).bind("throttledresize", setDefaultTransition);
});
